From: Bryan Dunsmore Date: Wed, 13 May 2020 05:38:01 +0000 (-0500) Subject: mpris: Prevent DBus race when creating media players X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~394 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f526e592fe11900bc311ebedab28713740bca212;p=gnome-shell.git mpris: Prevent DBus race when creating media players Sometimes an MPRIS media player will create and then destroy an object before the signals that handle the object's destruction can be created. This verifies that the object still exists after the necessary signals have been created. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2776 --- diff --git a/js/ui/mpris.js b/js/ui/mpris.js index 9eabe4431..23fca91b1 100644 --- a/js/ui/mpris.js +++ b/js/ui/mpris.js @@ -173,6 +173,11 @@ var MprisPlayer = class MprisPlayer { if (!this._mprisProxy.g_name_owner) this._close(); }); + // It is possible for the bus to disappear before the previous signal + // is connected, so we must ensure that the bus still exists at this + // point. + if (!this._mprisProxy.g_name_owner) + this._close(); } _onPlayerProxyReady() {